<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");
if ($_SESSION["permission"][$userGroupScreen]["View"]=="0"){
	echo "<script>alert('".$no_permit."');</script>";
	echo "<meta http-equiv = refresh ; content = '0 ; url = mainscreen.php'>";
	exit();
}

// show header
echo headerPage("User Group Maintenance");
?> 
<SCRIPT src="js/jquery.numeric.js"></script>
<SCRIPT src="js/js_usergroup.js"></SCRIPT> 
<script>
$(function() {
 
		$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
<FORM name="Act" action="<?php echo $PHP_SELF?>" method="post"> 
<INPUT type=hidden value="add" id="mode" name="mode"> 

<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10"  id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
                            <td>
							<?php  if ($_SESSION["permission"][$userGroupScreen]["Add"]=="1") {?>
								<a href="javascript:void('0');" id="btnAdd">
								<span class="icon_add"></span>Add
								</a>
							<?php }?>
							</td>
												  <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
                        </tr>
                        </table>
                    </div>
                      <div class="header"  style="background-image: url(images/usersGroup.png);">
                        User Group Maintenance
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
                    <table width="100%" id='searchdata'>
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">Group Name : </td>
									<td width="85%" align=left >
										<input id="txtGroupName"  title="Filter by user name "  type="text"  	size=40 name="code" class="boxItem" />
									</td>
                         </tr>
						       <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">Type : </td>
									<td width="85%" align=left >
										<select name="cboType" style="width:10em;"  id="cboType">
										<option value="0" selected>All</option>
										<option value="1">Head Office</option>
										<option value="2">Branch</option>
										</select>
									</td>
                         </tr>
						 <tr><td/><td>
						 <a href="javascript:void('0');" id="btnSearch"><img src="./images/btn-search.gif" border=0/></a> </td></tr>
						 <tr><td colspan="2"></tr>
                    </table>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="5%">No.</th>
								<th style="display:none">id</th>
								<th class="title" width="40%">Group Name</th>
								<th  class="title" width="30%" nowrap="nowrap">Type</th>
								<th  class="title" width="10%" nowrap="nowrap">Discount(%)</th>
								<th  style='display:none' class="title" width="5%" nowrap="nowrap">View</th>
								<th  class="title" width="5%" nowrap="nowrap">Edit</th>
								<th  class="title" width="5%" nowrap="nowrap">Del</th>
                      </tr>
                    </thead>
                   <tbody>
                 
                     </tbody>
                     <tfoot>
                         <tr>
                            <td colspan="8">
								 <div class="boxfooter">
								 <div id="paging_btn"> </div>
								 <div class="totalpage">Total : <span id="rowCount"></span>&nbsp;&nbsp;rows</div>

							</div>
							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10"  id='leftboder' style="border-right:2px solid #facb0c;">&nbsp;</td>
  
  </tr>
</table>
</FORM>
<div id="dialog-form"  style="height:550px">
	<p class="validateTips">* fields are required.</p>
	<form>
	<table cellpadding="0" cellspacing="0" border="0" width="100%" class="fieldset">
		<tr>
			<td width="30%"><label for="name" >Group Name *</label></td>
			<td width="70%"><input type="text" name="GroupName"  id="GroupName" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
 
		<tr>
			<td width="30%"><label for="name" >Type *</label></td>
			<td width="70%">
				<input type="radio" name="Type"  id="Type_1" value="1"  checked />Head Office
				<input type="radio" name="Type"  id="Type_2" Value="2"  />Branch
			</td>
		</tr>
	 
		<tr>
			<td width="30%"><label for="name" >Discount (%) *</label></td>
			<td width="70%"><input type="text" name="Discount"  id="Discount" maxlength="3" class="text ui-widget-content ui-corner-all" /></td>
		</tr>

		<tr>
			<td colspan="2">
				<table id="PermissionTable" cellspacing="1" width="100%" cellpadding="3" border="0" style="background-color:#f9f9f9;font-size:12px;border:1px solid #EAEAEA;">
						<thead>
							<tr style="background-color:#CCC;font-weight:bold;">
								<th width="9%">No.</th>
								<th width="55%">Screen Name</th>
								<th width="9%">View</th>
								<th width="9%">Add</th>
								<th width="9%">Edit</th>
								<th width="9%">Del</th>
							</tr>
						</thead>
						<tbody style="font-weight:normal;background-color:#fff">
						</tbody>
						<tfoot>
							<tr>
								<td colspan="6" align="left" style="font-size:11px;font-weight:bold;">Rows : <span id='iCount' style="color:red">0</span></td>
							</tr>
						</tfoot>
				</table>
			</td>
		</tr>
	</table>
</form>
</div>
  
<div id="dialog-confirm" title="Confirm delete?" style="padding-top:20px;">
	<p style="font-size:13px"><span class="ui-icon ui-icon-alert" 
		style="float:left; margin:0 7px 20px 0;">
		</span>Are you sure to delete this Group?</p>
</div>
<?php echo footer();?>